package com.ms.client.task.api.service;

import java.util.Map;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.ms.client.task.api.pojo.TaskJob;
import com.ms.msclient.MsClient;
import com.ms.msclient.MsClientResponse;
import com.system.comm.model.Page;

@MsClient(value="${service.id.task}", defalut="ms-cloud-task")
public interface ApiTaskJobService {

	/**
	 * 分页获取信息
	 * @param taskJob
	 * @return
	 */
	@RequestMapping(value = "/api/taskJob/pageQuery")
	public MsClientResponse<Page<TaskJob>> pageQuery(TaskJob taskJob);

	/**
	 * 保存
	 * @param taskJob
	 * @return
	 */
	@RequestMapping(value = "/api/taskJob/save")
	public MsClientResponse<TaskJob> save(TaskJob taskJob);
	/**
	 * 获取对象
	 * @param taskJob
	 * @return
	 */
	@RequestMapping(value = "/api/taskJob/get")
	public MsClientResponse<TaskJob> get(@RequestParam("id") Integer id);
	/**
	 * 修改任务状态
	 * @param id
	 * @param status
	 * @return
	 */
	@RequestMapping(value = "/api/taskJob/updateStatus")
	public MsClientResponse<TaskJob> updateStatus(@RequestParam("id") Integer id, @RequestParam("status") Integer status);
	/**
	 * 执行job
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "/api/taskJob/execJob")
	public MsClientResponse<TaskJob> execJob(@RequestParam("id") Integer id);
	/**
	 * 获取项目状态的任务数目
	 * @return
	 */
	@RequestMapping(value = "/api/taskJob/findProjectidCount")
	public MsClientResponse<Map<String, Object>> findProjectidCount();
	/**
	 * 获取正常执行的任务数目
	 * @return
	 */
	@RequestMapping(value = "/api/taskJob/findServidCount")
	public MsClientResponse<Map<String, Object>> findServidCount();
	/**
	 * 删除
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "/api/taskJob/delete")
	public MsClientResponse<TaskJob> delete(@RequestParam("id") Integer id);
}
